package com.rjgc.title.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rjgc.title.common.util.DateUtil;
import com.rjgc.title.mapper.LearningExperienceMapper;
import com.rjgc.title.model.entity.student.LearningExperience;
import com.rjgc.title.service.LearningExperienceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 学习经历 服务实现类
 * </p>
 *
 * @author 卓抱抱
 * @since 2022-04-25
 */
@Service
public class LearningExperienceServiceImpl extends ServiceImpl<LearningExperienceMapper, LearningExperience> implements LearningExperienceService {

    @Autowired
    private LearningExperienceMapper learningExperienceMapper;

    /**
     *  // 学习经历
     * @param userId
     * @return
     */
    @Override
    public List<LearningExperience> getLearningExperience(String userId) {
        QueryWrapper<LearningExperience> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("userId",userId);
        List<LearningExperience> learningExperiences = learningExperienceMapper.selectList(queryWrapper);
        return learningExperiences;
    }

    /**
     * 查询所有
     * @param userId
     * @return
     */
    @Override
    public List<LearningExperience> getAll(String userId) {

        QueryWrapper<LearningExperience> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("userId",userId);
        List<LearningExperience> learningExperiences = learningExperienceMapper.selectList(queryWrapper);
        return learningExperiences;
    }
}
